package com.yanyeori.framework.web.http.request.okhttp;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenkuan 2024/6/5
 */
@Configuration
@ConditionalOnClass(name = "okhttp3.Interceptor")
public class OkHttpRequestConfig {

    @Bean
    @ConditionalOnMissingBean(name = "okHttpRequestInterceptor")
    public OkHttpRequestInterceptor okHttpRequestInterceptor() {
        return new OkHttpRequestInterceptor();
    }
}
